
#pragma once

#include "type.h"
#include "equipment.h"
#include "formation.h"

typedef long long int64_t;

#define GM                     GameManager::getInstance()

#define X_SCALE(s)             (GM->xscale * (s))
#define Y_SCALE(s)             (GM->yscale * (s))
#define SCALE_PT(s)            ccp(X_SCALE(s.x), Y_SCALE(s.y))
#define XY_SCALE(x,y)          ccp(GM->xscale * (x), GM->yscale * (y))
#define MIN_SCALE(x, y)        ccp(GM->minscale * (x), GM->minscale * (y))

class Unit;
class GameScene;

class GameManager: public CCObject {
public:
    static const int BASE_WIDTH = 960;
    static const int BASE_HEIGHT = 576;
	static const int DESIGN_DPI = 132;
	static const int DESIGN_WIDTH_INCH = 5;

	static GameManager * getInstance();
	~GameManager();

	void startBattle();
	void endBattle();

	bool floatEquals(float a, float b);
	bool pointEquals(const CCPoint &a, const CCPoint &b);

public:
	CCSize screenSize;
	float xscale;
	float yscale;
	float minscale;
	float dpi;

	GameScene* gameScene;

private:
	GameManager();
	static GameManager *_instance;

};
